package callnumber.gtdev5.com.photoVault.utils;

import android.content.Context;
import android.os.PowerManager;

/**
 * Created by qp
 * PackageName FakeCall
 * 2018/6/23 17:34 唤醒屏幕
 */

public class WakeAndLockUtils {
    Context mcontext;
    PowerManager pm;
    PowerManager.WakeLock wakeLock;

    public WakeAndLockUtils(Context context) {
       this.mcontext=context;
        pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        wakeLock = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP
                | PowerManager.SCREEN_DIM_WAKE_LOCK, "WakeAndLock");
    }

    /**
     * 唤醒屏幕
     */
    public void screenOn() {
        wakeLock.acquire();
        android.util.Log.i("cxq", "screenOn");
    }


}
